package cn.kcrxorg.areacashcenter.fragment;

import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;

import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xpage.base.XPageListFragment;
import com.xuexiang.xpage.enums.CoreAnim;
import com.xuexiang.xui.adapter.listview.XListAdapter;
import com.xuexiang.xui.adapter.simple.AdapterItem;
import com.xuexiang.xui.adapter.simple.XUISimpleAdapter;

import java.util.ArrayList;
import java.util.List;

import cn.kcrxorg.areacashcenter.data.model.CashBox;
import cn.kcrxorg.areacashcenter.data.model.CashBoxError;

@Page(name = "扫描错误信息", anim = CoreAnim.none)
public class CashBoxErrorFragment extends XPageListFragment {

    List<CashBoxError> cashBoxErrorList;
    List<AdapterItem> data;
    @Override
    protected void initData() {
        Bundle arguments = getArguments();
        cashBoxErrorList= (List<CashBoxError>) arguments.getSerializable("cashBoxErrorList");
        data=new ArrayList<AdapterItem>();
        for(CashBoxError ce:cashBoxErrorList)
        {
                data.add(new AdapterItem(ce.getCashBoxCode()+" "+ce.getError()));
        }
        mListView.setAdapter(new XUISimpleAdapter(getContext(),data));

    }

    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

    }
}
